<?php
// +----------------------------------------------------------------------
// | genadmin [ genadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\admin\validate\user;

use think\Validate;

/**
 * 会员卡表验证器
 */
class VipValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'name' => 'require',
        'adv' => 'require',
        'price' => 'require',
        'sprice' => 'require',
        'discount' => 'require',
        'day' => 'require',
        'download' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'name' => '会员卡标题必须填写',
        'adv' => '角标文字必须填写',
        'price' => '售卖价格必须填写',
        'sprice' => '原价必须填写',
        'discount' => '折扣必须填写',
        'day' => '天数必须填写',
        'download' => '下载次数必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'name',
            'adv',
            'price',
            'sprice',
            'discount',
            'day',
            'download',
        ],
        'update' => [
            'name',
            'adv',
            'price',
            'sprice',
            'discount',
            'day',
            'download',
        ],
    ];

}
